<include file="Public:header"/>					
<div id="content">
	<div id="content-header">
		<h1>高级设置</h1>
	</div>
	<div id="breadcrumb">
		<a href="" title="回到首页" class="tip-bottom"><i class="fa fa-home"></i> 首页</a>
		<a href="#">系统设置</a>
		<a href="#" class="current">高级设置</a>
	</div>
	<div class="container-fluid">
		<div class="row">
			<div class="col-xs-12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon">
							<i class="fa fa-folder-open"></i>									
						</span>
						<h5>高级设置</h5>
					</div>
					<div class="widget-content nopadding">
						<form  method="get" class="form-horizontal">							
							<div class="form-group">
                                <label class="col-sm-3 col-md-3 col-lg-1 control-label">邮箱主机</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-file"></i></span>
                                    	<input type="text" value="{$Think.config.MAIL_HOST}" class="form-control input-sm" id="host"/>
                                    </div>
                                </div>
                            </div>
							
							<div class="form-group">
								<label class="col-sm-3 col-md-3 col-lg-1 control-label">描述</label>
								<div class="col-sm-9 col-md-9 col-lg-10">
									<textarea rows="5" class="form-control" disabled>需要修改本页参数，请确保对此页参数的了解。否则请联系作者：admin@loveteemo.com</textarea>
								</div>
							</div>
							
							<div class="form-group">
                                <label class="col-sm-3 col-md-3 col-lg-1 control-label">修改时间</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="row">
                                		<div class="col-md-6">
                                    		<input type="text" value="{:date("Y-m-d H:i:s",time())}" class="form-control input-sm" readonly=""/>
                                    	</div>
                                    </div>
                                </div>
                            </div>
                            
							<div class="form-group">
                                <label class="col-sm-3 col-md-3 col-lg-1 control-label">STMP服务</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    	<input type="text" value="TRUE" class="form-control input-sm" readonly="" />
                                    </div>
                                </div>
                            </div>
                            
                             <div class="form-group">
                                <label class="col-sm-3 col-md-3 col-lg-1 control-label">STMP权限</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    	<input type="text" value="TRUE" class="form-control input-sm" readonly />
                                    </div>
                                </div>
                            </div>
                            
                            <div class="form-group">
                            <label class="col-sm-3 col-md-3 col-lg-1 control-label">邮件安全</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    	<input type="text" value="tls" class="form-control input-sm" readonly/>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 col-md-3 col-lg-1 control-label">邮件编码</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    	<input type="text" value="UTF-8" class="form-control input-sm" readonly/>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 col-md-3 col-lg-1 control-label">邮箱用户</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    	<input type="text" value="{$Think.config.MAIL_USERNAME}" class="form-control input-sm" id="emailname"/>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 col-md-3 col-lg-1 control-label">密码</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    	<input type="password" value="{$Think.config.MAIL_PASSWORD}" class="form-control input-sm" id="emailpwd" />
                                    </div>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 col-md-3 col-lg-1 control-label">默认点击量</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    	<input type="text" value="{$Think.config.HIT}" class="form-control input-sm" id="defaulthit" />
                                    </div>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 col-md-3 col-lg-1 control-label">默认排序</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    	<input type="text" value="{$Think.config.SORT}" class="form-control input-sm" id="defaultsort"/>
                                    	<input type="hidden" value="__SELF__" id="jump" />
                                    </div>
                                </div>
                            </div>
							
							<div class="form-actions">
								<button type="button" class="btn btn-success btn-sm addemail">保存配置</button>  <button type="button" class="btn btn-danger btn-sm">取消</button>
							</div>
						</form>
					</div>
				</div>						
			</div>
		</div>
	</div>
</div>
<include file="Public:footer"/>
<script>
	$(document).ready(function(){
    $('.addemail').click(function(){
		var jump = $("#jump").val();
    	var host = $("#host").val();
    	var emailname = $("#emailname").val();
    	var emailpwd = $("#emailpwd").val();
    	var hit = $("#defaulthit").val();
    	var sort = $("#defaultsort").val();
		if(!host){
			err("邮箱主机不能为空!");
			return false;
		}else if(!emailname){
			err("邮件用户名不能为空!");
			return false;
		}else if(!emailpwd){
			err("邮件密码不能为空!");
			return false;
		}else if(!hit){
			err("默认点击量不能为空!");
			return false;
		}else if(!sort){
			err("默认排序不能为空!");
			return false;
		}
		$(".addemail").attr("disabled",true);
		$.ajax({
			type:"post",
			url:"/Admin/System/emailH",
			async:true,
			data:{"HOST":host,"MAIL_USERNAME":emailname,"MAIL_PASSWORD":emailpwd,"HIT":hit,"SORT":sort},
			success:function(data){
				if(data.error==0){
					succ("修改高级设置完成!",data.msg,jump);
				}else{
					err(data.msg);
					$(".addemail").removeAttr('disabled');
				}
			},
			eerror:function(data){
				err("网络错误!");
				$(".addemail").removeAttr('disabled');
			}
		});
	});
});
</script>
</body>
</html>
